package com.acme.bankapp.listeners.email;

import com.acme.bankapp.domain.bank.Client;
import com.acme.bankapp.listeners.ClientRegistrationListener;

public class EmailNotificationListener implements ClientRegistrationListener {
	private EmailService es;

	@Override
	public void onClientAdded(Client tclient) {
		Email email = new Email(tclient.getName() + "@"+"email.xxx");
		tclient.setEmail(email);
		es.sendNotificationEmile(tclient.getEmail());
	}

	public void setEService(EmailService es) {
		this.es = es;
	}
	public EmailNotificationListener(EmailService es) {
		this.es=es;
	}
}
